//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Validation Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.Validation.Configuration.Design.Nodes;
using EntLibContrib.Validation.Configuration.Design.Properties;

namespace EntLibContrib.Validation.Configuration.Design
{
	/// <summary>
	/// Validation Node Map Registrar
	/// </summary>
	public class ValidationNodeMapRegistrar : NodeMapRegistrar
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ValidationNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public ValidationNodeMapRegistrar(IServiceProvider serviceProvider)
			: base(serviceProvider)
		{
		}
		#endregion

		#region Public Methods
		/// <summary>
		/// Registers the node maps.
		/// </summary>
		public override void Register()
		{
			base.AddMultipleNodeMap(Resources.ExternallyConfiguredObjectCollectionValidatorNodeName, typeof(ExternallyConfiguredObjectCollectionValidatorNode), typeof(ExternallyConfiguredObjectCollectionValidatorData));
			base.AddMultipleNodeMap(Resources.ExternallyConfiguredObjectValidatorNodeName, typeof(ExternallyConfiguredObjectValidatorNode), typeof(ExternallyConfiguredObjectValidatorData));
			base.AddMultipleNodeMap(Resources.CollectionCountValidatorNodeName, typeof(CollectionCountValidatorNode), typeof(CollectionCountValidatorData));
			base.AddMultipleNodeMap(Resources.CompositeRuleSetValidatorNodeName, typeof(CompositeRuleSetValidatorNode), typeof(CompositeRuleSetValidatorData));
			base.AddMultipleNodeMap(Resources.EnumDefinedValidatorNodeName, typeof(EnumDefinedValidatorNode), typeof(EnumDefinedValidatorData));
			base.AddMultipleNodeMap(Resources.TypeValidatorNodeName, typeof(TypeValidatorNode), typeof(TypeValidatorData));
		}
		#endregion
	}
}
